package com.zx.mes.hyl.security.core.validate.code;

import org.springframework.web.context.request.ServletWebRequest;

/**
 * 校验码存取器 接口
 * @author huayunlong
 * @date 2018-6-2
 */
public interface ValidateCodeRepository {

    /**
     * 保存校验码
     * @param request ServletWebRequest
     * @param code ValidateCode
     * @param type ValidateCodeType
     */
    void save(ServletWebRequest request,ValidateCode code,ValidateCodeType type);

    /**
     * 获取校验码
     * @param request ServletWebRequest
     * @param type ValidateCodeType
     * @return ValidateCode
     */
    ValidateCode get(ServletWebRequest request,ValidateCodeType type);

    /**
     * 移除验证码
     * @param request ServletWebRequest
     * @param type ValidateCodeType
     */
    void remove(ServletWebRequest request,ValidateCodeType type);
}
